<template>
  <div class="js-table">
    <table>
      <thead>
        <tr>
          <th v-for="(header, index) in headers" :key="index">{{ header }}</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(row, rowIndex) in rows" :key="rowIndex">
          <td v-for="(cell, cellIndex) in row" :key="cellIndex">{{ cell }}</td>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const headers = ref(['ID', '名称', '状态'])
const rows = ref([
  ['1', '项目A', '激活'],
  ['2', '项目B', '未激活']
])
</script>

<style scoped>
.js-table table {
  width: 100%;
  border-collapse: collapse;
}

.js-table th,
.js-table td {
  border: 1px solid #ddd;
  padding: 8px;
}
</style>